use ClientDW_A

//remove IQ from CapitalIqId
db.RPCompanyProfile.find().forEach(function(obj){
    db.RPCompanyProfile.update(obj, {$set:{"CapitalIQID": obj.CapitalIQID.replace('IQ',"")}})   
    //set CapitalIQID field to int 
    obj.CapitalIQID = new NumberInt(obj.CapitalIQID);
    db.RPCompanyProfile.save(obj);
})
db.RPCompanyProfile.updateMany({}, {$rename:{"CapitalIQID":"CapitalIqId"}})

use ClientDW_B
//remove IQ from CapitalIQID
db.RPCompanyProfile.find().forEach(function(obj){
    db.RPCompanyProfile.update(obj, {$set:{"CapitalIQID": obj.CapitalIQID.replace('IQ',"")}})    
    //set CapitalIQID field to int
    obj.CapitalIQID = new NumberInt(obj.CapitalIQID);
    db.RPCompanyProfile.save(obj);
})

db.RPCompanyProfile.updateMany({}, {$rename:{"CapitalIQID":"CapitalIqId"}})